package com.xuecheng.ucenter.feignclient;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author cyf
 * @version 1.0
 * @description #TODO
 * @date 2024/11/7 14:01
 */
@Slf4j
@Component
public class CheckCodeClientFactory implements FallbackFactory<CheckCodeClient> {

    @Override
    public CheckCodeClient create(Throwable throwable) {
        return new CheckCodeClient() {
            @Override
            public Boolean verify(String key, String code) {
                //降级方法
                log.debug("调用验证码服务验证时发生熔断，异常信息:{}",throwable.toString(),throwable);
                return null;
            }
        };
    }
}
